﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp4
{
    public class Book
    {
        public int id;

        public string title;

        public int _price;
       public int Id
        {
            get
            {
                return id;
            }
            set
            {
                id = value;
            }
        }
        public string Title
        {
            get
            {
                return title;
            }
            set
            {
                title = value;
            }
        }
        public int Price 
        {
            get
            {
                return _price;
            }
            set
            {
                if (value >= 1 && value <= 100)
                    {
                        _price = value;
                    }
                    else
                    {
                        _price = 0;
                    }
                }
            }
       
        public void PrintBookInfo()
        {
            Console.WriteLine("书的编号:{0} 书名:{1} 书的价格:{2}", this.id, this.title, this._price);
        }


        ~Book()
        {
            Console.WriteLine("限量收藏款{0}只需32!!!", Title);
        }
    }
}
